package com.efesco.service.onOff;

import com.bstek.dorado.common.*;
import com.bstek.dorado.data.*;
import com.bstek.dorado.view.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;
import com.efesco.common.*;

/**
 * MultiImportInterfaceViewModel
 */
public class MultiImportInterfaceViewModel extends DefaultViewModel {
  protected void doLoadData()
      throws Exception {
    // Add your code here
    super.doLoadData();
  }

  protected void doUpdateData(ParameterSet parameters, ParameterSet outParameters)
      throws Exception {
    // Add your code here
    super.doUpdateData(parameters, outParameters);
  }
  
  public void modifyInterface(ParameterSet parameters, ParameterSet outParameters)
      throws Exception {
	  Dataset dsInfo=this.getDataset("datasetBasInfo");
	  Dataset ds=this.getDataset("datasetProductItem");
	  ds.moveFirst();
	  while(!ds.isLast()){
		  if (Tools.toStr(ds.getString("item_id")).equals("")){
			  ds.setValue("item_id",DBTools.getNewId("general"));
			  ds.setValue("MULTI_IMPORT_INTERFACE_ID",dsInfo.getValue("MULTI_IMPORT_INTERFACE_ID"));
		  }
		  ds.moveNext();
	  }
	  super.doUpdateData(parameters,outParameters);
  }

}
